<?php 
require '../fbsrc/facebook.php';

     $signed_request = $_REQUEST["signed_request"];

     list($encoded_sig, $payload) = explode('.', $signed_request, 2); 

     $data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);


	$facebook = new Facebook(array(
	'appId'  => '231095003576729',
	'secret' => '25b3b4f964cb0e726aea7ab95d7709b7',
	'cookie' => true,
	));

	$method = $data["user_id"] . '/friends';

	$friendslist = $facebook->api($method);
	foreach($friendslist['data'] as $v){
		print_r ('<b>' . $v['id'] . '</b>' . '<br>' );
		$friend_apistr = $v['id'];
		$friend_info = $facebook->api($friend_apistr);
		if($friend_info['education'] != null)
		{
			foreach ($friend_info['education'] as $edu)
			{
				print ($edu['school']['name'] . '<br>');
			}
		}


	}

?>